﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Angle
{
    using System.Reflection;
    using System.Web.Http;

    using Angle.Application.UserServices;

    using Skymate.Engines;
    using Skymate.Mvc;
    using Skymate.Mvc.Controllers.Dynamic.Builders;
    using Skymate.Services;

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            DynamicApiControllerBuilder
                .ForAll<ISkymateService>(Assembly.GetAssembly(typeof(IUserService)),"angle")
                .Build();

            EngineContext.Initialize(false);

            MvcInitialize.InitializeAspNetServices(GlobalConfiguration.Configuration);


            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            MvcInitialize.InitializeRoutes(GlobalConfiguration.Configuration);

            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}
